<?php

if( $login = lib::islogin() ){
	$user = lib::getitem('user');
	$uid = lib::getitem('user')->id;
	$username = lib::getitem('user')->username;
}

?>
<div class="container">
	<div id="logo"></div>
	<h1>拾客</h1>
	<h2>——找回曾经的拥有！</h2>
	<ul id="nav">
		<li><a href="/" title="Index" id="nav-index">首页</a></li>
		<li><a href="/lost" title="Lost" id="nav-lost">寻物启事</a></li>
		<li><a href="/found" title="Found" id="nav-found">招领启事</a></li>
		<li><a href="/article" title="Letter" id="nav-letter">文章中心</a></li>
		<li><a href="/about" title="About_us" id="nav-about">关于我们</a></li>
	</ul>
	<form id="searchbox" action="/search" method="get">
		<input type="text" id="keyword" name="keyword" value="" placeholder="找东西" />
		<input type="submit" id="searchbtn" value="搜索" />
		<span class="pipe">|</span><a href="/search/advance">高级搜索</a>		
	</form>
	<div id="login">
		<img src="/assets/images/usericon.png" alt="成员登录" id="usericon" />
		<?php if($login) {?>
		<a href="/user/view/<?=$uid?>"><?=$username?></a><span class="pipe">|</span><a href="/home">个人中心</a><span class="pipe">|</span><a href="/logout">退出</a>
		<?php } else {?>
		<a href="/login">登录</a><span class="pipe">|</span><a href="/register">注册</a><span class="pipe">|</span><a id="bookmark" href="#" onclick="addBookmark()">收藏</a>
		<?php }?>
	</div>
</div>